import store from '@/store';
import { setQuesMessages } from '@/utils/index';
import { OllamaMessages } from '@/interface/home';

/**
 * @description 刷新消息
 * @param {number} index 当前消息索引
 * @returns OllamaMessages[]
 */
export const refreshMessages = (index: number): OllamaMessages[] =>
  setQuesMessages(store.state.messages.slice(0, index));
